home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Languages
/
MacGofer 0.22d
/
MacGofer Sources
/
parser.y
< prev
next >
Wrap
Text File
|
1993-08-25
|
29KB
|
48 lines
/* --------------------------------------------------------------------------
* parser.y: Copyright (c) Mark P Jones 1991-1993. All rights reserved.
* See goferite.h for details and conditions of use etc...
* Gofer version 2.28 January 1993
*
* You should expect 14 shift/reduce conflicts when passing
* this grammar through yacc. Don't worry, they will all be
* resolved correctly as shifts.
*
* There will also be 5 reduce/reduce conflicts. These are
* more worrying although they will still be resolved correctly
* as long as you keep the two grammar rules concerned (see the
* y.output file for details) in the same order as used here.
*
* Gofer parser (included as part of input.c)
* ------------------------------------------------------------------------*/
%{
#ifndef lint
#define lint
#endif
#define defTycon(n,l,lhs,rhs,w) tyconDefn(intOf(l),lhs,rhs,w); sp-=n
#define sigdecl(l,vs,t) ap(SIGDECL,triple(l,vs,t))
#define grded(gs) ap(GUARDED,gs)
#define letrec(bs,e) (nonNull(bs) ? ap(LETREC,pair(bs,e)) : e)
#define yyerror(s) /* errors handled elsewhere */
#define YYSTYPE Cell
static Cell local gcShadow Args((Int,Cell));
static Void local syntaxError Args((String));
static String local unexpected Args((Void));
static Cell local checkPrec Args((Cell));
static Void local fixDefn Args((Syntax,Cell,Cell,List));
static Void local setSyntax Args((Int,Syntax,Cell));
#if MAC
Cell local buildTuple Args((List));
#else
static Cell local buildTuple Args((List));
#endif
static Cell local checkClass Args((Cell));
static List local checkContext Args((List));
static Cell local tidyInfix Args((Cell));
/* For the purposes of reasonably portable garbage collection, it is
* necessary to simulate the YACC stack on the Gofer stack to keep
* track of all intermediate constructs. The lexical analyser
* pushes a token onto the stack for each token that is found, with
* these element